package a.f.a;

import a.c.*;
import a.c.d;
import a.i.a.o;
import a.i.p;

class i
  implements a.a.y
{
  q a;
  boolean b = false;
  boolean c = false;
  
  public w a(q paramq)
  {
    int i = e.M;
    boolean bool = e.L;
    this.a = paramq;
    ab localab = new ab();
    if (i == 0)
    {
      if (!a()) {
        localab = a.a.m.b(paramq);
      }
      if (i != 0) {}
    }
    else if (!b())
    {
      localab.a(a.a.m.e(paramq));
    }
    a.c.bb localbb;
    do
    {
      localbb = d();
      while (!bool)
      {
        if (localab.isEmpty()) {
          break;
        }
        paramq.a(localab.o());
      }
    } while (i != 0);
    return localbb.l();
  }
  
  public void a(boolean paramBoolean)
  {
    this.c = paramBoolean;
    if ((e.M != 0) || (!this.c)) {
      this.b = false;
    }
  }
  
  public boolean a()
  {
    return this.b;
  }
  
  public void b(boolean paramBoolean)
  {
    this.b = paramBoolean;
    if ((e.M != 0) || (this.b)) {
      this.c = true;
    }
  }
  
  public boolean b()
  {
    return this.b;
  }
  
  a.c.bb d()
  {
    int k = e.M;
    boolean bool = e.L;
    if (k == 0) {
      if (this.a.k() < 3) {
        return new a.c.bb(this.a.v());
      }
    }
    x localx1 = this.a.B();
    x localx2 = this.a.B();
    n localn = this.a.C();
    o localo = new o(this.a, new b_(), 0, c(this.a));
    int i = this.a.k();
    ab localab1 = new ab();
    ab localab2 = new ab();
    a.i.y localy = new a.i.y(this.a);
    label137:
    if (i > 3) {}
    label243:
    label250:
    Object localObject8;
    label392:
    label524:
    label662:
    label674:
    label748:
    label883:
    label886:
    label1015:
    do
    {
      localObject1 = localo.g();
      localObject2 = new Integer(i);
      if (bool) {
        break label1057;
      }
      localObject3 = ((a.c.e)localObject1).o();
      do
      {
        do
        {
          if (!((w)localObject3).e()) {
            break;
          }
          localx1.a(((w)localObject3).d(), localObject2);
          localx2.a(((w)localObject3).d(), false);
          ((w)localObject3).f();
          if (k != 0) {
            break label250;
          }
          if (bool) {
            break label243;
          }
        } while (!bool);
      } while (k != 0);
      localObject3 = ((a.c.e)localObject1).o();
      Object localObject4;
      do
      {
        if (!((w)localObject3).e()) {
          break;
        }
        localObject4 = ((w)localObject3).d();
        if (bool) {
          break label946;
        }
        localObject6 = ((a.c.e)localObject4).n();
        do
        {
          do
          {
            if (!((a.c.m)localObject6).e()) {
              break;
            }
            localObject7 = ((a.c.m)localObject6).a();
            if (bool) {
              break label392;
            }
            if (localx1.getInt(((d)localObject7).f()) == i)
            {
              localab2.add(localObject7);
              localx2.a(((d)localObject7).e(), true);
              localx2.a(((d)localObject7).f(), true);
            }
            ((a.c.m)localObject6).f();
          } while (!bool);
          ((w)localObject3).f();
        } while (k != 0);
      } while (!bool);
      if (k != 0) {
        break label137;
      }
      if (localab2.size() < ((a.c.e)localObject1).c() - 1)
      {
        localObject3 = null;
        localObject4 = ((a.c.e)localObject1).o();
        if (((w)localObject4).e()) {}
        while (k != 0)
        {
          localObject6 = ((w)localObject4).d();
          if (bool) {
            break label674;
          }
          if (localx1.getInt(localObject6) == i)
          {
            if (k != 0) {
              break label524;
            }
            if (!localx2.getBool(localObject6)) {
              if ((k != 0) || (localObject3 == null))
              {
                localObject3 = localObject6;
                if (k != 0) {
                  break label524;
                }
                if (!bool) {}
              }
              else
              {
                localObject7 = this.a.a((a.c.e)localObject3, (a.c.e)localObject6);
                localn.a(localObject7, true);
                localab2.add(localObject7);
                localObject3 = null;
              }
            }
          }
          ((w)localObject4).f();
          if (!bool) {
            break;
          }
        }
        if ((k != 0) || (localObject3 != null))
        {
          localObject4 = ((a.c.e)localObject1).o();
          do
          {
            if (!((w)localObject4).e()) {
              break;
            }
            if (k != 0) {
              break label886;
            }
            localObject6 = ((w)localObject4).d();
            if (bool) {
              break label883;
            }
            if (((k != 0) || (localObject6 != localObject3)) && ((k != 0) || (((a.c.e)localObject6).c((a.c.e)localObject3) == null)))
            {
              localObject7 = this.a.a((a.c.e)localObject3, (a.c.e)localObject6);
              localn.a(localObject7, true);
              localab2.add(localObject7);
              if (k != 0) {
                break label662;
              }
              if (!bool) {
                break;
              }
            }
            ((w)localObject4).f();
          } while (!bool);
        }
        if (k != 0) {
          break label137;
        }
        if (localab2.size() < ((a.c.e)localObject1).c() - 1)
        {
          int j = 2147483647;
          localObject6 = null;
          localObject7 = ((a.c.e)localObject1).o();
          do
          {
            do
            {
              if (!((w)localObject7).e()) {
                break label748;
              }
              localObject8 = ((w)localObject7).d();
              if (bool) {
                break;
              }
              if (((a.c.e)localObject8).c() < j)
              {
                localObject6 = localObject8;
                j = ((a.c.e)localObject8).c();
              }
              ((w)localObject7).f();
            } while (!bool);
          } while (k != 0);
          localObject7 = ((a.c.e)localObject1).o();
          do
          {
            if (!((w)localObject7).e()) {
              break;
            }
            if (k != 0) {
              break label886;
            }
            localObject8 = ((w)localObject7).d();
            if (bool) {
              break label883;
            }
            if ((k != 0) || ((((a.c.e)localObject6).c((a.c.e)localObject8) == null) && (localObject6 != localObject8)))
            {
              d locald = this.a.a((a.c.e)localObject6, (a.c.e)localObject8);
              localn.a(locald, true);
              localab2.add(locald);
              if (k == 0) {
                if (localab2.size() >= ((a.c.e)localObject1).c() - 1) {
                  break;
                }
              }
            }
            else
            {
              ((w)localObject7).f();
            }
          } while (!bool);
        }
      }
      if (k != 0) {
        break;
      }
      localObject3 = ((a.c.e)localObject1).o();
      do
      {
        if (!((w)localObject3).e()) {
          break label936;
        }
        localObject5 = ((w)localObject3).d();
        localo.e((a.c.e)localObject5);
        ((w)localObject3).f();
        if ((k == 0) && (bool)) {
          break;
        }
      } while (!bool);
      if (k != 0) {
        break label1059;
      }
      localObject3 = localab2.l();
      do
      {
        do
        {
          if (!((a.c.m)localObject3).e()) {
            break label1015;
          }
          localObject5 = ((a.c.m)localObject3).a();
          if (bool) {
            break;
          }
          if (localn.getBool(localObject5))
          {
            localo.d(((d)localObject5).e());
            localo.d(((d)localObject5).f());
          }
          ((a.c.m)localObject3).f();
        } while (!bool);
        localab1.a(localab2);
        localy.a((a.c.e)localObject1);
        i--;
      } while (k != 0);
      if (!bool) {
        break;
      }
      localy.g();
    } while (k != 0);
    label936:
    label946:
    localo.e();
    label1057:
    label1059:
    Object localObject1 = localab1.l();
    label1140:
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      if (bool) {
        break label1156;
      }
      if (((d)localObject2).c() != null)
      {
        if (k == 0)
        {
          if (localn.getBool(localObject2)) {
            this.a.a((d)localObject2);
          }
        }
        else
        {
          if (k != 0) {
            continue;
          }
          if (!bool) {
            break label1140;
          }
        }
        this.a.f((d)localObject2);
      }
      ((a.c.m)localObject1).f();
    } while (!bool);
    label1156:
    localObject1 = a.a.bb.a(this.a);
    Object localObject2 = new a.c.bb();
    Object localObject3 = (d)((ab)localObject1).a(0);
    Object localObject5 = (d)((ab)localObject1).a(1);
    Object localObject6 = null;
    if (k == 0) {
      if (((d)localObject3).e() != ((d)localObject5).e())
      {
        if (k != 0) {
          break label1246;
        }
        if (((d)localObject3).e() != ((d)localObject5).f()) {
          break label1241;
        }
      }
    }
    localObject6 = ((d)localObject3).f();
    break label1248;
    label1241:
    label1246:
    localObject6 = ((d)localObject3).e();
    label1248:
    ((a.c.bb)localObject2).add(localObject6);
    Object localObject7 = ((ab)localObject1).l();
    do
    {
      do
      {
        if (!((a.c.m)localObject7).e()) {
          break;
        }
        localObject8 = ((a.c.m)localObject7).a();
        localObject6 = ((d)localObject8).a((a.c.e)localObject6);
        ((a.c.bb)localObject2).add(localObject6);
        ((a.c.m)localObject7).f();
        if (k != 0) {
          break label1340;
        }
        if (bool) {
          break label1333;
        }
      } while (!bool);
    } while (k != 0);
    localObject7 = localab1.l();
    label1333:
    label1340:
    do
    {
      if (!((a.c.m)localObject7).e()) {
        break;
      }
      localObject8 = ((a.c.m)localObject7).a();
      if ((k == 0) && (bool)) {
        break label1447;
      }
      if (k == 0)
      {
        if ((!localn.getBool(localObject8)) && ((k != 0) || (((d)localObject8).c() == null))) {
          this.a.g((d)localObject8);
        }
        ((a.c.m)localObject7).f();
      }
    } while (!bool);
    this.a.a(localx2);
    this.a.a(localn);
    this.a.a(localx1);
    if (k == 0) {
      a((a.c.bb)localObject2);
    }
    label1447:
    return localObject2;
  }
  
  void a(a.c.bb parambb)
  {
    int i = e.M;
    boolean bool = e.L;
    if (parambb.size() < this.a.k())
    {
      x localx = this.a.B();
      Object localObject = parambb.f();
      if (localObject != null) {}
      a.c.e locale1;
      while (i != 0)
      {
        locale1 = (a.c.e)((v)localObject).c();
        localx.a(locale1, localObject);
        localObject = ((v)localObject).a();
        if ((i == 0) && (bool)) {
          return;
        }
        if (!bool) {
          break;
        }
      }
      label137:
      label139:
      label267:
      label279:
      label326:
      do
      {
        localObject = new o(this.a, new a_(localx), 0, parambb.size(), new a_(localx));
        break label279;
        if (((o)localObject).a()) {
          break;
        }
        locale1 = ((o)localObject).h();
        w localw = locale1.o();
        a.c.e locale2;
        if (localw.e()) {
          locale2 = localw.d();
        }
        do
        {
          do
          {
            if (bool) {
              break label326;
            }
            if (localx.get(locale2) != null)
            {
              v localv1 = (v)localx.get(locale2);
              a.c.e locale3 = (a.c.e)parambb.f(localv1).c();
              v localv2 = null;
              if (locale1.c(locale3) != null) {
                localv2 = parambb.a(locale1, localv1);
              } else {
                localv2 = parambb.b(locale1, localv1);
              }
              localx.a(locale1, localv2);
              if (i == 0) {
                if (!bool) {
                  break label267;
                }
              }
            }
            else
            {
              localw.f();
            }
            if (!bool) {
              break label137;
            }
            if (i != 0) {
              break label139;
            }
            localw = locale1.o();
            if (!localw.e()) {
              break;
            }
            locale2 = localw.d();
            if ((i != 0) || (bool)) {
              break label360;
            }
          } while (i != 0);
        } while (bool);
        if (localx.get(locale2) == null) {
          ((o)localObject).d(locale2);
        }
        localw.f();
      } while (!bool);
      if (i == 0) {
        this.a.a(localx);
      }
      label360:
      ((o)localObject).e();
    }
  }
  
  int c(q paramq)
  {
    int j = e.M;
    boolean bool = e.L;
    int i = 0;
    do
    {
      w localw = paramq.v();
      while (!bool)
      {
        if (!localw.e()) {
          break;
        }
        if (j == 0)
        {
          if (bool) {
            break label67;
          }
          i = Math.max(i, localw.d().c());
          localw.f();
        }
      }
    } while (j != 0);
    label67:
    return i;
  }
  
  static class b_
    extends p
  {
    public int getInt(Object paramObject)
    {
      return ((a.c.e)paramObject).c();
    }
  }
  
  static class a_
    extends p
  {
    x c;
    
    a_(x paramx)
    {
      this.c = paramx;
    }
    
    public int getInt(Object paramObject)
    {
      int j = e.M;
      boolean bool = e.L;
      int i = 0;
      w localw = ((a.c.e)paramObject).o();
      do
      {
        do
        {
          if (!localw.e()) {
            break;
          }
          if (this.c.get(localw.d()) != null) {
            i++;
          }
          localw.f();
        } while (!bool);
      } while (j != 0);
      return i;
    }
    
    public boolean getBool(Object paramObject)
    {
      return this.c.get((a.c.e)paramObject) == null;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.a.i

 * JD-Core Version:    0.7.0.1

 */